//package com.lottery.ruok.lottrey.adapter.fragmentManager;
//
//import com.lottery.ruok.lottrey.fragment.AllLotteryFragment;
//import com.lottery.ruok.lottrey.fragment.BaseFragment;
//import com.lottery.ruok.lottrey.fragment.CategoryFragment;
//import com.lottery.ruok.lottrey.retrofitModule.response.GetWholeCategoryResponse;
//
//import java.util.HashMap;
//import java.util.Iterator;
//import java.util.List;
//import java.util.Map;
//
///**
// * 使用前一定要先设置data数据
// */
//public class BuyPagerFragmentManager {
//
//    public static HashMap<String, BaseFragment> map = new HashMap<>();
//
//    public static BaseFragment getFragment(int index,int size,String key) {
//        BaseFragment fragment = null;
//
//        if (map.containsKey(key)) {
//            fragment = map.get(key);
//            if (fragment != null) {
//                return fragment;
//            }
//        }
//        if (index==size-1) {
//            fragment = new AllLotteryFragment();
//        } else {
//            fragment = new CategoryFragment();
//        }
//        map.put(key, fragment);
//        return fragment;
//    }
//
////    public static int getSize() {
////        if (data != null) {
////            return data.size();
////        } else {
////            return 0;
////        }
////    }
////
////    public static String getPageTitle(int position) {
////        if(data.size() > position){
////            return data.get(position).getName();
////        } else {
////            return "";
////        }
////    }
////
////    public static void setData(List<GetWholeCategoryResponse> tempData) {
////        data = tempData;
////        //如果已经加载fragment 需要更新fragment数据
////        if (map.size() > 0) {
////            Iterator<Map.Entry<Integer, BaseFragment>> entries = map.entrySet().iterator();
////            while (entries.hasNext()) {
////                Map.Entry<Integer, BaseFragment> entry = entries.next();
////                if (entry.getKey() != data.size() - 1) {
////                    entry.getValue().setDatas(data.get(entry.getKey()));
////                }
////            }
////        }
////    }
////
////    public static List<GetWholeCategoryResponse> getData() {
////        return data;
////    }
//}
